//
//  JTY_Macro.h
//  JTY_App
//
//  Created by jty on 2025/3/29.
//

#ifndef JTY_Macro_h
#define JTY_Macro_h

#define WEAKSELF       typeof(self) __weak weakSelf = self;

#define KWITH  [UIScreen mainScreen].bounds.size.width
#define KHEIGHT  [UIScreen mainScreen].bounds.size.height

#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]
#define UIColorFromRGBA(rgbValue, alphaValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0x00FF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0x0000FF))/255.0 \
alpha:alphaValue]
#define UIColorFromRGB(rgbValue) UIColorFromRGBA(rgbValue, 1.0)
#define HEXCOLOR(rgbValue) UIColorFromRGBA(rgbValue, 1.0)
#define HEXCOLOR_ALPHA(rgbValue,alpha) UIColorFromRGBA(rgbValue, alpha)

#define FORMAT(String,...) [NSString stringWithFormat:String,__VA_ARGS__]

#define NOTNullStr(string) [NSString stringWithFormat:@"%@",([string isEqual:@""] || (string == nil) ||[string isEqual:[NSNull null]] || [string isKindOfClass:[NSNull class]] || [string isEqual:@"(null)"])?@"":string]

#endif /* JTY_Macro_h */
